<? 
	pr($this->session->all_userdata());
	if($this->session->userdata('ss_user_id')) { 
?>
<a href="<?=PATH_URL.'user/logout'?>">Logout</a>
<?php
	}else{
?>
<script type="text/javascript">
$(function() {
	$('#password').keypress(function(e) {
		 if(e.which == 13){
			login();
		}
	});

});
function login(){
	var url= root+'user/login';
	if($('#email').val()!='')
	{
		$.post(
			url,
			$('#fr_login').serialize(),
			function(data){
				console.log(data);
				return false;
				switch(data.st){
					case('SUCCESS'):
						
						break;
					case('NOT_ACTIVE'):
						show_popup_user('active');
						break;
					default:
						$('.p_notification').html(data.txt);
						break;
						
				}
			},'json'
		);
	}
}
</script>
<form action="" id="fr_login" method="post" enctype="multipart/form-data">
	<input type="text" name="email" id="email" /><br>
	<input type="password" name="password" id="password" />
	<input type="hidden" name="type" value="fb" />
	<input name="remember" type="checkbox" value="checked"><br>
	<input name="btn" value="Login" type="button" onclick="return login()">
	<input name="btn_fb" value="FB Login" type="button" onclick="return FB_LOGIN()">
	
</form>
<? 	} ?>